﻿@model PartyInvite.Models.GuestResponse

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Thanks</title>
    <link href="~/content/bootstrap.css" rel="stylesheet" />
    <link href="~/content/bootstrap-theme.css" rel="stylesheet" />
    <link href="~/content/site.css" rel="stylesheet">
    <style>
        .btn a {
            color: white;
            text-decoration: none;
        }

        body {
            background-color: #F5F5F5;
        }
    </style>
</head>
<body>
    <div id="wrap">
        <div class="container">

            @{
                try
                {
                    WebMail.SmtpServer = "smtp.1and1.com";
                    WebMail.SmtpPort = 587;
                    WebMail.EnableSsl = true;
                    WebMail.UserName = "dummy@ezparty.us";
                    WebMail.Password = "4516200";
                    WebMail.From = "rsvps@ezparty.us";

                    var s = string.Format("{0} will be {1} attending.\n Contact details:\n{2}\n{3}", Model.Name, (Model.WillAttend ?? false) ? "" : "not", Model.Email, Model.Phone);

                    WebMail.Send("dummy@ezparty.us", "RSVP Notification", s);
                <div class="text-center">
                    <h1>Thank you! @Model.Name</h1>
                    @if (Model.WillAttend == true)
                    { 
                        @:It's great that you are coming.
            }
                    else
                    {
                        @:Sorry to hear that you cannot make it! But thanks for letting us know.
            }

                </div>
           
                }
                catch (Exception e)
                {
                <div class="text-center">
                    <b>Sorry - we couldn't send the email to confirm your RSVP.</b>
                    @e.ToString(); 
                </div>
                } 
            
            }

        </div>
    </div>

    <div id="footer">
        <div class="container">
            <div class="text-center">
                <p class="muted credit">Courtesy of <a href="http://www.fortetek.com" target="_blank">Forte Software Tech. Inc.</a></p>
            </div>
        </div>
    </div>

</body>
</html>
